const {
    Keypair,
    Transaction,
    SystemProgram,
    LAMPORTS_PER_SOL,
    TransactionMessage,
    TransactionInstruction
} = require("@solana/web3.js");

const MpcVersionedTransaction = require('./MpcVersionedTransaction');
function transactionMessage(payerPubKey, recentBlockHash, instructions) {
    console.log('payerPubKey: ', payerPubKey);
    console.log('payerBubKeytoBase58(): ', payerPubKey.toBase58());
    let messageV0 = new TransactionMessage({payerKey:payerPubKey, recentBlockhash:recentBlockHash, instructions:instructions}).compileToV0Message();
    const transaction = new MpcVersionedTransaction(messageV0);
    return transaction;
}
module.exports = {
    transactionMessage
};